package cn.pzhu.model;

/**
 * Created by dongp on 2016/5/9.
 */
public class PageBean {

	// 总条数
	private int total;
	// 当前页
	private int pageOffset;
	// 每页大小
	private int pageSize;
	// 总页数
	private int totalPage;

	// 分页初始化
	public PageBean() {
		this.pageOffset = 1;
		this.pageSize = 6;
		this.total = 0;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getPageOffset() {
		return pageOffset;
	}

	public void setPageOffset(int pageOffset) {
		this.pageOffset = pageOffset;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotalPage(){
		int tp = total / pageSize;
		return total % pageSize == 0 ? tp : tp + 1;// 如果求余不为零说明多了一页
	}
}
